package com.moli.iov.admin.service.impl;

import com.moli.iov.admin.service.CompanyVehicleModelService;
import com.moli.iov.base.model.dto.req.CompanyVehicleModelReqDto;
import com.moli.iov.base.model.dto.req.QueryCompanyVehicleModelListParamDto;
import com.moli.iov.base.model.dto.res.CompanyVehicleModelResDto;
import com.moli.iov.base.remote.ICompanyVehicleModelRemoteService;
import com.moli.iov.model.dto.req.PageExtend;
import com.moli.iov.rest.RestResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基础设置> 车机型号管理
 *
 * @author whl
 */
@Slf4j
@Service
@RestController
public class CompanyVehicleModelServiceImpl implements CompanyVehicleModelService {

  @Reference(group = "${service.group}", check = false)
  private ICompanyVehicleModelRemoteService iCompanyVehicleModelRemoteService;


  @Override
  public RestResponse saveCompanyVehicleModel(
      CompanyVehicleModelReqDto companyVehicleModelReqDto) {
    return iCompanyVehicleModelRemoteService.saveCompanyVehicleModel(companyVehicleModelReqDto);
  }

  @Override
  public RestResponse updateCompanyVehicleModel(
      CompanyVehicleModelReqDto companyVehicleModelReqDto) {
    return iCompanyVehicleModelRemoteService.updateCompanyVehicleModel(companyVehicleModelReqDto);
  }

  @Override
  public RestResponse<CompanyVehicleModelResDto> getCompanyVehicleModelDetails(Long id) {
    return iCompanyVehicleModelRemoteService.getCompanyVehicleModel(id);
  }

  @Override
  public RestResponse<PageExtend<CompanyVehicleModelResDto>> listCompanyVehicleModel(
      QueryCompanyVehicleModelListParamDto queryCompanyVehicleModelListParamDto) {
    return iCompanyVehicleModelRemoteService
        .listCompanyVehicleModels(queryCompanyVehicleModelListParamDto);

  }
}
